
//立体旋转
define(['progress.min'], function() {
	var mySwiper = new Swiper('.swiper-container', {
		progress: true,
		loop: false,
		mode: 'vertical',
		onProgressChange: function(swiper) {
			for (var i = 0; i < swiper.slides.length; i++) {
				var slide = swiper.slides[i];
				var progress = slide.progress;
				var rotate = -90 * progress;
				if (rotate < -90) rotate = -90;
				if (rotate > 90) rotate = 90;
				var translate = progress * swiper.width / 2;
				var opacity = 1 - Math.min(Math.abs(progress), 1);
				slide.style.opacity = opacity;
				swiper.setTransform(slide, 'rotateX(' + rotate + 'deg) translate3d(0,' + translate + 'px,0)');
			}
		},
		onTouchStart: function(swiper) {
			for (var i = 0; i < swiper.slides.length; i++) {
				swiper.setTransition(swiper.slides[i], 0);
			}
		},
		onSetWrapperTransition: function(swiper, speed) {
			for (var i = 0; i < swiper.slides.length; i++) {
				swiper.setTransition(swiper.slides[i], speed);
			}
		},
		onSlideChangeEnd: function(swiper){
			window.initAni($(swiper.visibleSlides), swiper.activeLoopIndex);
			window.clearAni($(swiper.wrapper).children().eq(swiper.previousIndex));
		}
	});

});